﻿// See https://aka.ms/new-console-template for more information

using Dx.Test.MySqlEntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

IServiceCollection services=new ServiceCollection();
services.AddDbContextPool<MyDbContext>(opt => {
    opt.UseMySql("Data Source=localhost;Database=sys_portal;AllowLoadLocalInfile=true;User ID=root;Password=root;allowPublicKeyRetrieval=true;pooling=true;CharSet=utf8;port=3306;sslmode=none;", new MySqlServerVersion(new Version(5, 7, 36)));

});
var app= services.BuildServiceProvider();
var db= app.GetService<MyDbContext>();
await db.Database.MigrateAsync();
Console.WriteLine("Hello, World!");
